package com.example.ieservice;

import android.content.Context;
import android.inputmethodservice.Keyboard;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

/**
 * Created by richard on 09/04/14.
 */
public class RowAdapter extends BaseAdapter
{
    private List<Row> elements;
    private Context context;

    public RowAdapter(Context c, List<Row> rows) {
        this.elements = rows;
        this.context = c;
    }

    @Override
    public int getCount() {
        return elements.size();
    }

    @Override
    public Object getItem(int position) {
        return elements.get(position);
    }

    @Override
    public long getItemId(int id) {
        return id;
    }



    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        //return elements.get(position);
        Row hello = (Row) convertView;
        if (hello == null) {
            // inflate a new view
            hello = (Row)
                    LayoutInflater.from(this.context).inflate(R.layout.row, parent, false);
        }
       // hello.setHelloString(getItem(position));
        return hello;

    }
}
